STEP 1: Let's start by generating a random number!

Variables can store values that change or values that we don't know in advance.

  • In the LOGIC tab, go to and drag Random Integer into the editor.

We've added a dice sprite that will show you the random number. You won't be able to see it in your code yet. If the random number is higher than 6, you will see a Codesters sprite because dice only go up to 6.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)